// dlg.txt

begintalkscript;

variables;

begintalknode 1;
	state = -1;
	nextstate = -1;
	condition = get_sdf(8,1) == 0;
	question = "special";
	text1 = "You emerge from the tunnel into an isolated valley high up in the mountains. You have never been here before. It doesn't look like anyone has been here in a long time. The sheet of snow on the pathway is completely undisturbed.";
	text2 = "There is something here though. The valley to the east is blocked by a large stone dome. Two creatures stand guard, lurking motionlessly outside the door. When they see you, they shake off the inches of snow that cover them.";
	text3 = "They are creations. Strange, freakish creations. They stand on four legs, like roamers, but they come from different stock. In fact, they look like their body parts have been borrowed from many different creatures.";
	text4 = "They are awkward, ungainly creatures, all muscle. Their skin is smooth, pale, and shades of a sickly pink. Each stares at you with a single softly glowing eye. When you get close, they growl in unison.";
	text5 = "Mehken grabs your arm. _Do not like this place. Hear warnings. Not wise to come here. We should go._";
	action = SET_SDF 8 1 1;
	code =
		if (char_in_party(47) < 0)
			rs(5);
	break;
	
begintalknode 2;
	state = -1;
	nextstate = -1;
	condition = gf(8,3) == 0 && gf(2,3) < 4;
	question = "special";
	text1 = "You check the scrying crystal. It is completely dark. The Presence is not here.";
	action = SET_SDF 8 3 1;

begintalknode 3;
	state = -1;
	nextstate = -1;
	condition = gf(8,6) < 2 && gf(8,4) == 0;
	question = "special";
	text1 = "The golem behind you turns to see what you are doing. Then it points at you. It opens its mouth, and a loud, keening wail emerges.";
	code =
		sf(8,4,1);
		make_zone_hostile();
	break;
	
begintalknode 4;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "The guardian makes a long, hideous gurgling noise when you get close. You back away.";

begintalknode 5;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You have found the only warm area in the Repository. In fact, it's uncomfortably hot. Being near this power spiral instantly makes you break out into a sweat.";
	text2 = "You immediately realize the foolishness of trying to tinker with it. A slight mishap would result in a spectacular explosion. Your best hope for interfering with it is the nearby control panel.";

begintalknode 6;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "As this defender falls, it lets out a piercing shriek. It carries surprisingly well through the wind, echoing easily along the canyon walls.";
	text2 = "It has called for help. You wonder if anything is going to respond.";
	code =
		set_act_at_dist(1001,1);
	break;
	
begintalknode 7;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";



begintalknode 10;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "When you enter the dome, you see a statue in the center. A huge, lumpy, ugly thing. Then the statue starts to move. Another Shaper creation, a shell of stone surrounding flesh and muscle. And a brain.";
	text2 = "It opens its mouth, the stone of its lips forming an immobile 'O' shape. Words float out of the darkness beyond. _You have entered the Foundry Repository. Please show your key or depart._";
	text4 = "The golem turns toward you. The stones that plate its limbs rub together, making a painful scraping noise. _You must present a key to enter the Repository. Otherwise, you will be destroyed._";
	text6 = "The golem turns toward you. The stones that plate its limbs rub together, making a painful scraping noise. _You may enter the Repository._";
	code =
		clear_strings();
		if (gf(8,6) == 0) {
			as(1);
			as(2);
			sf(8,6,1);
			}
			else if (gf(8,6) == 1)
				as(4);
				else if (gf(8,6) == 2)
					as(6);
	break;
	
begintalknode 11;
	state = 10;
	nextstate = -1;
	condition = gf(8,6) == 1 && gf(8,7) == 0;
	question = "I don't have a key.";
	text1 = "The golem says, _None without a key may enter, on the order of Shaper Rawal. Depart or be destroyed._";
	text2 = "The golem closes its mouth and returns to its immobile state.";
	action = END_TALK;
	
begintalknode 12;
	state = 10;
	nextstate = -1;
	condition = gf(8,6) == 1 && gf(8,7) == 0 && get_stat(20) > 3;
	question = "Shaper Rawal sent me here. I need to search the Repository.";
	text1 = "It's as if you hadn't said anything. _None without a key may enter, on the order of Shaper Rawal. Depart or be destroyed._";
	text2 = "Clever words won't be enough to fool the golem. It closes its mouth and returns to its immobile state.";
	action = END_TALK;
	
begintalknode 13;
	state = 10;
	nextstate = -1;
	condition = gf(8,6) == 1 && gf(8,7) > 0;
	question = "I have a Repository key. (Show it.)";
	text1 = "The golem doesn't move. There is a long silence. Then the golem says, _It is genuine. You may access your vault._";
	text2 = "Then it speaks again, in a noticeably different voice. _The Foundry Repository is currently closed, due to difficulties controlling the guardians. Please return to Minallah._";
	action = SET_SDF 8 6 2;
	
begintalknode 14;
	state = 10;
	nextstate = 11;
	condition = gf(8,6) == 2;
	question = "Tell me about the Repository.";
	text1 = "The golem speaks in the first voice it used. _Shapers who wish to place a valued item or set of documents in a secure location may bring it to the Foundry. For a fee, these items will be kept perfectly safe._";
	text2 = "Then the golem speaks in the second voice, repeating what it said before. _The Foundry Repository is currently closed, due to difficulties controlling the guardians. Please return to Minallah._";

begintalknode 15;
	state = 10;
	nextstate = 12;
	condition = gf(8,6) == 2;
	question = "What is wrong with the guardians?";
	text1 = "The golem says, in the second voice it used, _The defenders will attack all intruders on sight. This is unfortunate. Shaper Rawal assures you that the problem will be corrected soon._";

begintalknode 16;
	state = 10;
	nextstate = 15;
	condition = gf(8,6) == 2;
	question = "Where is the vault I need to find?";
	text1 = "The golem says, in the first voice, _When you insert the key, the proper door will be opened remotely. A crystal will then light to indicate where you should go._";

begintalknode 17;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "What is stored here?";
	text1 = "The golem says (in the first voice), _Discretion is one of the main features of the Repository. The nature of your deposit will be kept completely secret by the Councilor in charge._";

begintalknode 18;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "When will the Repository be open again?";
	text1 = "The golem says (in the first voice), _Shaper Rawal provides his personal assurance that the guardians will soon be brought under control. He is giving his full attention to restoring your access to your deposits._";
	text2 = "Somehow you doubt that.";

begintalknode 19;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "I command you to control the defenders.";
	text1 = "The golem calmly repeats what it said. _The defenders will attack all intruders on sight. This is unfortunate. Shaper Rawal assures you that the problem will be corrected soon._";
	
begintalknode 20;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "Tell me about the defenders.";
	text1 = "The golem reverts to the first voice it used. _The Shaper Repository is guarded by a class of creation created specifically for its alertness, ferocity, and endurance._";
	text2 = "_Those making deposits in the Repository are assured that attempted thieves will meet an end both rapid and horrifying._";

begintalknode 21;
	state = 12;
	nextstate = -1;
	condition = get_stat(20) <= 3;
	question = "How are the defenders controlled?";
	text1 = "The golem makes a long, garbled sound. It vibrates slightly. It seems to be trying to give two responses at the same time. Finally, confused, it gives up.";

begintalknode 22;
	state = 12;
	nextstate = 13;
	condition = get_stat(20) > 3;
	question = "How are the defenders controlled?";
	text1 = "The golem makes a long, garbled sound. It vibrates slightly. It seems to be trying to give two responses at the same time. Your presence calms it, though. Finally, it manages to give a coherent response.";
	text2 = "It says, in its first voice, _The defenders are controlled from a center. They are sent instructions and energy to sustain them through conduits._";
	
begintalknode 23;
	state = 13;
	nextstate = -1;
	condition = get_stat(20) <= 7;
	question = "Where is this control center?";
	text1 = "The golem makes a long, garbled sound. It vibrates slightly. It seems to be trying to give two responses at the same time. Finally, confused, it gives up.";

begintalknode 24;
	state = 13;
	nextstate = -1;
	condition = get_stat(20) > 7;
	question = "Where is this control center?";
	text1 = "The golem makes a long, garbled sound. It vibrates slightly. It seems to be trying to give two responses at the same time. Once again, your presence calms it.";
	text2 = "It says, in its first voice, _The control center is in the southeast corner of the complex. Leave to the east and follow the right wall._";
	
begintalknode 25;
	state = 15;
	nextstate = 16;
	condition = 1;
	question = "Where do I insert the key?";
	text1 = "The golem reverts to the second voice. _The Foundry Repository is currently closed, due to difficulties controlling the guardians. Please return to Minallah._";
	
begintalknode 26;
	state = 16;
	nextstate = -1;
	condition = get_stat(20) > 5;
	question = "All right. Where would Shaper Rawal insert a key? If he was here?";
	text1 = "The golem makes a long, garbled sound. Its helpful and unhelpful halves struggle for dominance. Finally, the good side wins.";
	text2 = "_The access point is in the very center of the complex._";

begintalknode 27;
	state = 10;
	nextstate = -1;
	condition = gf(8,6) == 2;
	question = "That is all I need to know.";
	text1 = "The golem finally says, in the second voice. _The Foundry Repository is currently closed, due to difficulties controlling the guardians. Please return to Minallah._";
	text2 = "The golem closes its mouth and returns to its immobile state.";
	action = END_TALK;

//


begintalknode 30;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You brush the snow off this sign. It says:";
	text2 = "  Repository Bay B";
	
begintalknode 31;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You brush the snow off this sign. It says:";
	text2 = "  Repository Bay C";
	
begintalknode 32;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You brush the snow off this sign. It says:";
	text2 = "  Repository Bay D";
	
begintalknode 33;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You brush the snow off this sign. It says:";
	text2 = "  Repository Bay E";
	
begintalknode 34;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You brush the snow off this sign. It says:";
	text2 = "  Repository Bay G";
	
begintalknode 35;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You brush the snow off this sign. It says:";
	text2 = "  Guardian Control";
	
begintalknode 36;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You brush the snow off this sign. It says:";
	text2 = "   Guardian Swarm";
	
begintalknode 37;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "__";

begintalknode 40;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There is a crystal case in the middle of this rune-inscribed circle. You aren't sure if the circle is here to keep something in or out. The only thing in the circle is a crystal case.";
	text2 = "You open the case and find a thick glass vial. Inside it, you see a wad of red, fleshy goo. Unnervingly, the flesh is still twitching. It slowly edges from one edge of the vial to the other. With regret, you take it.";
	text3 = "The case is still empty.";
	code =
		sf(8,5,1);
		if (gf(8,21) == 0) {
			rs(3);
			sf(8,21,1);
			set_spec_item(35,1);
			}
			else {
				rs(2);
				}
	break;
	
begintalknode 41;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You flip through the pages of this book. It is the journal of a craftsman named Paras, who seems to have been the guardian of a forge in the Whitespires for a long time.";
	text2 = "It contains records of many of his experiments using the forge. Most of them apparently ended in spectacular failure, combined with the waste of valuable materials. You do find notes about some rare successes:";
	text3 = "_The Councilor will be pleased! At last I have made a pair of items! This should do much to calm his rage. In both cases, I started with a sturdy, mundane length of wood._";
	text4 = "_In the first case, the power of the forge locked the energy of a glaahk eye into the wood, using aura spores as a binding agent._";
	text5 = "_The second case was similar, except the power source was a flawless drakon scale and berserker spores served for binding._";
	text6 = "_Hopefully these successes will please the Councilor enough that he will pay me my back wages and release my family from the cells._";
	
begintalknode 42;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "This is a lab journal from the Foundry Core. It is dusty and ignored, and the pages are covered with burns and stains. Many sections, probably the ones that contained any information of use, have been cut out.";
	text2 = "Only one entry seems of use. It describes an unusual amnesiac, brought in from the wastes near the Drypeak Mountains. You soon realize that it is describing you. It was written three years ago:";
	text3 = "_Without forbidden rebel tools, we can only guess at the deep nature of the subject. We can only guess exactly how it has been modified. It has been reShaped extensively, though._";
	text4 = "_Powers have been etched into it, abilities now as natural and innate as taking a breath or raising a hand. Too many changes have been made, though. The result has been mental instability. The subject is a highly pliable amnesiac._";
	text5 = "_It was suggested to Councilor Rawal that the newly developed Geneforge is the only resource we have that could restore the subject. Only an extensive restoration of the previous physical state can help the subject._";
	text6 = "_Councilor Rawal rejected this suggestion, doubtless for his own unquestionably wise reasons. Subject was turned over to the Councilor for further observation._";
	code =
		sf(8,5,1);
	break;
	
begintalknode 43;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "There is a blue steel box by this wall. When you open it, you find that it is a sample case. It is full of vials of powder, bone chips, goo, and dust. All are unlabeled. Most are probably useless to you.";
	text2 = "In a rack at the bottom, you do find one sample of interest. It is a thick glass jar. Inside it, you see a tiny fyora, pickled in spirits. Though the date on the label is no longer legible, it is clearly very old. You take it.";
	text3 = "There is nothing inside of value.";
	code =
		sf(8,5,1);
		if (gf(8,22) == 0) {
			rs(3);
			sf(8,22,1);
			set_spec_item(36,1);
			}
			else {
				rs(2);
				}
	break;


begintalknode 44;
	state = -1;
	nextstate = -1;
	condition = 1;
	question = "special";
	text1 = "You flip through this book and find that it is actually a long series of scrolls, bound together. They all concern the governance of the city of Mera-Tev. Proclamations, laws, treaties, and so on.";
	text2 = "One section has been marked with a bookmark. It contains letters exchanged between Councilor Astoria and Greta, a diplomat working on behalf of the rebels, all concerning a possible peace treaty. You tear the section out and pocket it.";
	text3 = "While it would all be fascinating to a student of political science, the papers no longer concern you.";
	code =
		sf(8,5,1);
		if (gf(8,23) == 0) {
			rs(3);
			sf(8,23,1);
			set_spec_item(37,1);
			}
			else {
				rs(2);
				}
	break;
	
	//

begintalknode 50;
	state = -1;
	nextstate = 50;
	condition = 1;
	question = "Name";
	text1 = "You inspect this control panel. Although it lacks any sort of label, instructions, or information that would be helpful to anyone but its maker, part of it seems clear enough.";
	text2 = "There are eight holes in the fleshy surface. They are clearly keyholes.";


begintalknode 51;
	state = 50;
	nextstate = -1;
	condition = has_spec_item(41) > 0;
	question = "Insert and turn Repository Key B.";
	text1 = "After a little trial and error, you find the hole that key B fits into. You insert the key and turn it. There is a click.";
	text2 = "One of the glowing crystals in the center of the room begins to flicker green.";
	text3 = "You find the hole that key B fits into. You insert the key and try to turn it. It doesn't budge.";
	code =
		if (gf(8,10) == 0) {
			sf(8,10,1);
			rs(3);
			}
			else {
				rs(1); rs(2);
				}
	break;
	
begintalknode 52;
	state = 50;
	nextstate = -1;
	condition = has_spec_item(42) > 0;
	question = "Insert and turn Repository Key C.";
	text1 = "After a little trial and error, you find the hole that key C fits into. You insert the key and turn it. There is a click.";
	text2 = "One of the glowing crystals in the center of the room begins to flicker green.";
	text3 = "You find the hole that key C fits into. You insert the key and try to turn it. It doesn't budge.";
	code =
		if (gf(8,11) == 0) {
			sf(8,11,1);
			rs(3);
			}
			else {
				rs(1); rs(2);
				}
	break;
	
begintalknode 53;
	state = 50;
	nextstate = -1;
	condition = has_spec_item(43) > 0;
	question = "Insert and turn Repository Key D.";
	text1 = "After a little trial and error, you find the hole that key D fits into. You insert the key and turn it. There is a click.";
	text2 = "One of the glowing crystals in the center of the room begins to flicker green.";
	text3 = "You find the hole that key D fits into. You insert the key and try to turn it. It doesn't budge.";
	code =
		if (gf(8,12) == 0) {
			sf(8,12,1);
			rs(3);
			}
			else {
				rs(1); rs(2);
				}
	break;
	
begintalknode 54;
	state = 50;
	nextstate = -1;
	condition = has_spec_item(44) > 0;
	question = "Insert and turn Repository Key E.";
	text1 = "After a little trial and error, you find the hole that key E fits into. You insert the key and turn it. There is a click.";
	text2 = "One of the glowing crystals in the center of the room begins to flicker green.";
	text3 = "You find the hole that key E fits into. You insert the key and try to turn it. It doesn't budge.";
	code =
		if (gf(8,13) == 0) {
			sf(8,13,1);
			rs(3);
			}
			else {
				rs(1); rs(2);
				}
	break;
	
begintalknode 55;
	state = 50;
	nextstate = -1;
	condition = has_spec_item(45) > 0;
	question = "Insert and turn Repository Key G.";
	text1 = "After a little trial and error, you find the hole that key G fits into. You insert the key and turn it. There is a click.";
	text2 = "One of the glowing crystals in the center of the room begins to flicker green.";
	text3 = "You find the hole that key G fits into. You insert the key and try to turn it. It doesn't budge.";
	code =
		if (gf(8,14) == 0) {
			sf(8,14,1);
			rs(3);
			}
			else {
				rs(1); rs(2);
				}
	break;
	
begintalknode 56;
	state = 50;
	nextstate = -1;
	condition = 1;
	question = "Leave the controls alone.";
	text1 = "There's nothing else to do here. You back away before you break something.";
	action = END_TALK;


//

begintalknode 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = "This control panel controls and modulates the considerable power flowing through the spiral next to it. The heat is considerable. The unfortunate creation in the panel sweats and makes little, unhappy squeaky noises.";
	text2 = "You try to manipulate the controls, but they are all frozen in place. Shaper Rawal has been taking precautions against intruders. However, there is an access panel at the bottom.";


begintalknode 71;
	state = 70;
	nextstate = -1;
	condition = gf(8,18) == 0;
	question = "Open the panel. (Use 1 living tool.)";
	text1 = "Sadly, you don't have the living tool.";
	text2 = "You try to use the living tool to access the lock mechanism, but your skill is lacking. Your clumsy efforts make the tool hiss in irritation. You soon give up.";
	text3 = "You use the living tool to access the lock mechanism. Your deft manipulations are soon rewarded with a satisfying click.";
	text4 = "The panel swings open, revealing the complicated workings within.";
	code =
		clear_strings();
		if (num_of_item(255) == 0)
			as(1);
			else if (get_stat(21) < 7)
				as(2);
				else {
					take_item(255);
					award_party_xp(100,7);
					sf(8,18,1);
					as(3); as(4);
					}
	break;
	

begintalknode 72;
	state = 70;
	nextstate = -1;
	condition = gf(8,18) > 0 && gf(8,16) == 0;
	question = "Weaken the power of the guardians. (Use 2 living tools.)";
	text1 = "Sadly, you don't have the living tools.";
	text2 = "You try to use the living tool to manipulate the machinery where it is attached to the living mass of the small creation. Alas, your skill is lacking. Your clumsy efforts make the tool hiss in irritation. You soon give up.";
	text3 = "You use the living tool to manipulate the machinery where it is attached to the living mass of the small creation. Your dexterity is rewarded. The power flow through the conduits is noticeably lower now.";
	text4 = "Should you have the misfortune of fighting the guardians, they will be weaker now.";
	code =
		clear_strings();
		if (num_of_item(255) < 2)
			as(1);
			else if (get_stat(21) < 7)
				as(2);
				else {
					take_item(255);
					take_item(255);
					award_party_xp(150,7);
					sf(8,16,1);
					as(3); as(4);
					}
	break;
	
begintalknode 73;
	state = 70;
	nextstate = -1;
	condition = gf(8,18) > 0 && gf(8,17) == 0;
	question = "Reduce the guardian detection radius. (Use 2 living tools.)";
	text1 = "Sadly, you don't have the living tools.";
	text2 = "You try to use the living tool to manipulate the machinery where it is attached to the living mass of the small creation. Alas, your skill is lacking. Your clumsy efforts make the tool hiss in irritation. You soon give up.";
	text3 = "You use the living tool to manipulate the machinery where it is attached to the living mass of the small creation. Your dexterity is rewarded. The power flow through the conduits starts to waver unpredictably.";
	text4 = "This varying charge should irritate and distract the creatures. As long as you don't get too close to them, they won't notice you.";
	code =
		clear_strings();
		if (num_of_item(255) < 2)
			as(1);
			else if (get_stat(21) < 9)
				as(2);
				else {
					take_item(255);
					take_item(255);
					award_party_xp(150,9);
					sf(8,17,1);
					as(3); as(4);
					}
	break;
	
begintalknode 74;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "Leave.";
	text1 = "You leave the panel alone. There's nothing else to do here.";
	action = END_TALK;

//

begintalknode 90;
	state = -1;
	nextstate = 90;
	condition = gf(8,24) == 0 && gf(8,25) == 0 && gf(8,26) == 0;
	question = "Name";
	text1 = "This vault is being used to store canisters. Some of them have been used recently. Their broken remains are in the corners. Four of them are still intact.";
	text2 = "You feel torn. Part of you feels compelled to use them. You stare into the swirling green essence, lusting for the power it would give you.";
	text3 = "But part of you is afraid. And rightly so. After all you have been through, allowing yourself to be Shaped again seems terribly risky. Submitting to the powers of the Shapers has cost you much.";
	action = SET_SDF 8 26 1;
	code =
		sf(8,5,1);
	break;
	
begintalknode 91;
	state = 90;
	nextstate = -1;
	condition = 1;
	question = "Smash the canisters.";
	text1 = "To turn away from such power is painful. Literally painful. Forcing your body to conform to your will makes all of your muscles ache. You marvel at your innate desire to use the canisters, even as you smash them.";
	text2 = "Soon, mercifully, the job is done. The canisters have been destroyed. You slowly recover.";
	action = END_TALK;
	code =
		sf(8,24,1);
		kill_object(107,0);
		kill_object(108,0);
		kill_object(109,0);
		kill_object(110,0);
	break;
	
begintalknode 92;
	state = 90;
	nextstate = -1;
	condition = 1;
	question = "Leave them alone for now.";
	text1 = "Sure, you could destroy the canisters now. But what's the rush? You can leave them alone for a little bit. What could happen?";
	text2 = "(If you change your mind and decide to destroy the canisters, leave the room for a few seconds and reenter.)";
	action = END_TALK;
				